]> dgit.raspbian.org Git - pcre2.git/commit
Backport of pcre2-10.48-Fix-JIT-match-context-reuse.patch
authorNicholas Wilson <nicholas@nicholaswilson.me.uk>
Sat, 8 Aug 2026 18:17:36 +0000 (19:17 +0100)
committerMatthew Vernon <matthew@debian.org>
Tue, 1 Sep 2026 10:43:48 +0000 (11:43 +0100)
commit2e17239e9c31bdc0e6478b15d4bf8039518179d9
tree4b1c30fdbea35e4f75b55f4d517165b94c970f43
parent4c5447960d8df0d951d9b8f08296c146d0033eaa
Backport of pcre2-10.48-Fix-JIT-match-context-reuse.patch

Cherry-pick of 1dcd0cf42a6a7cb62cc9a7c024196733abcfda95 and 1cad831209af67d24298c301a74c615d3a6d57eb

Fix leak & stale PCRE2_MD_COPIED_SUBJECT if pcre2_jit_match used with existing match context (#937)

The problem is not that pcre2_jit_match() needs to add support for PCRE2_COPY_MATCHED_SUBJECT. Instead, if the passed-in context somehow contains a previously-copied subject (by non-JIT matcher using a global or cached subject) then it will be leaked, and worse, incorrectly free'd later.

pcre2test: honor no_jit when used with jitfast (#946)

`pcre2_jit_match()` ignores the PCRE2_NO_JIT option, so teach pcre2test
to avoid calling it if the subject modifier that sets that option is
used together with the option to call it directly.

While at it, make jitverify more reliable and add a unittest to validate
that PCRE2_NO_JIT is ignored in the fast JIt path.

(cherry picked from commit e5b9232fc4cd6a0df312ae25568e72cd337cafa2)
src/pcre2_jit_match.c
src/pcre2test.c
testdata/testinput17
testdata/testoutput17